/**
 * @(#)TaskMgr.java, 2016-5-2.
 * <p>
 * Copyright 2016 Yodao, Inc. All rights reserved.
 * YODAO PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.scitc.pleasurevideo.helper;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 *
 * @author lukun
 *
 */
public class TaskMgr {

    ExecutorService fixedThreadPool = Executors.newFixedThreadPool(4);

    ExecutorService fixedThreadPool2 = Executors.newFixedThreadPool(10);

    static TaskMgr taskMgr;

    static {
        taskMgr = new TaskMgr();
    }

    private TaskMgr() {

    }

    public static TaskMgr getTaskMgr() {
        return taskMgr;
    }

    public void executeTask(final Runnable runnable) {
        fixedThreadPool.execute(runnable);
    }

    public void executeTask2(final Runnable runnable) {
        fixedThreadPool2.execute(runnable);
    }
}
